/*****************************************************************************/
** GLES Panel Data - Select Variables for Analyses
** by: CS (April 8, 2021)

** Note: We use the GLES Panel Dataset Version 5.0.0. We accessed the file on 
** July 24, 2021. Citation:
* GLES (2021): GLES Panel 2016-2021, Waves 1-15. GESIS Data Archive, Cologne. ZA6838 Data file Version 5.0.0, 
* https://doi.org/10.4232/1.13783

** We used the Stata DoFile provided by GESIS ("ZA6838_Wave_Match_v5-0-0") to merge
** all the datasets. In this DoFile, we select the relevant variables and create 
** a smaller dataset for the primary data manipulation and analyses.

clear all

** Open Merged Dataset 
use "C:\Users\User\Dropbox (Personal)\populism_concept stability\Data\GLES_Data_Untouched_24072021\ZA6838_allwaves_sA_v5-0-0.dta"

**Keep selected set of variables:

* - Running ID (lfdn)
* - Variable counting how many times respondent particiapted in Waves 1 through 15 (n_participation)
* - Education (kp1_2330)
* - Year of Birth (kpx_2290s)
* - Populism items (kpx_3103a-kpx3103h)
* - Political efficacy item complementing the populism scale (kpX_050a) 
* - Scalo Meter Government (kpx_730) - Wave 5, 8, 13, 14, and 15
* - Perception of general economic situation (kpx_820) - Wave 5, 8, 13, 14, and 15
* - Position on Immigration (KpX_1130) Wave 4, 8, 13, 14, and 15
* - Political Interestion (kpX_010) Waves 5-15
* - Climate Protection vs Economic Interests (kpX_1290) Wave 4/Wave A1, 7, 8, 10-15
* - Risk Preferences (kpX_1572) W1/W A1; W13, W14, W15
* - Attitudes towards democracy (kpX_050c, kpX_050g, kpX_050j) - Wave 10 not included 
*                               because wording for item G differed.
* - BIG 5 Inventory (kpa1_2180a-o and kp1_2180a-kpa1_2180o)
* - Voting Behaviour Zweitstimme - mail voting (kpX_193b), asked in two waves
* - Voting Behaviour Zweitstimme - in-person voting (kpX_200b), asked in two waves


keep lfdn n_participation kp5_3103a-kp5_3103h kp8_3103a-kp8_3103h kp9_3103a-kp9_3103h kp13_3103a-kp13_3103h ///
kp14_3103a-kp14_3103h kp15_3103a-kp15_3103h kp5_050a kp8_050a kp9_050a kp13_050a kp14_050a ///
kp15_050a kp5_730 kp8_730 kp13_730 kp14_730 kp15_730 kp5_820 kp8_820 kp13_820 kp14_820 kp15_820 ///
kp4_1130 kp8_1130 kp13_1130 kp14_1130 kp15_1130 ///
kp5_010 kp6_010 kp7_010 kp8_010 kp9_010 kp10_010 kp11_010 kp12_010 kp13_010 kp14_010 kp15_010 ///
kp4_1290 kpa1_1290 kp7_1290 kp8_1290 kp10_1290 kp11_1290 kp12_1290 kp13_1290 kp14_1290 kp15_1290 ///
kp1_1572 kpa1_1572 kp13_1572 kp14_1572 kp15_1572 ///
kp4_2090a kpa1_2090a ostwest kp8_180 ///
kp1_2180a kp1_2180b kp1_2180c kp1_2180d kp1_2180e kp1_2180f kp1_2180g kp1_2180h kp1_2180i kp1_2180j ///
kp1_2180k kp1_2180l kp1_2180m kp1_2180n kp1_2180o ///
kpa1_2180a kpa1_2180b kpa1_2180c kpa1_2180d kpa1_2180e kpa1_2180f kpa1_2180g kpa1_2180h kpa1_2180i kpa1_2180j ///
kpa1_2180k kpa1_2180l kpa1_2180m kpa1_2180n kpa1_2180o ///
kp2_050c kp2_050g kp2_050j kpa1_050c kpa1_050g kpa1_050j kp9_050c kp9_050g kp9_050j ///
kp12_050c kp12_050g kp12_050j kp15_050c kp15_050g kp15_050j kp14_050c kp14_050g kp14_050j ///
kp5_191ba kp9_191ba kp8_200ba kp9_200ba ///
kpx_2290s kp1_2330 kpa1_2330 sample

** Exclude refresh sample component A4 (added prior to Wave 13)
keep if sample !=6

** Export as csv file:
export delimited using "C:\Users\User\Dropbox (Personal)\populism_concept stability\Data\GLESP_17_21_SelectedVars.csv", replace
